﻿<template>
    <div class="home">
        <div class="context"  v-html="compiledMarkdown">
        </div>
    </div>
</template>
<script>
import marked from 'marked'
import { OneList } from '@/api/article'
export default {
    data() {
        return {
            id: { content: 'xx' }
        }
    },
    created() {
            this.getData()
    },
    computed: {
        compiledMarkdown () {
            return marked(this.id.content, { sanitize: true })
        }
    },
    methods: {
            async getData() {
            console.log(this.$route.query.id);
            const data = await OneList(this.$route.query.id)
            this.id = data[0];
            console.log(this.id.content);
        }
    }

}
</script>
<style lang="scss" scoped >
/* @media screen and (min-width: 780px) {
    .home{
    display: flex;
    width: 100%;
    height: auto;
    justify-content: center;
    align-items: center;
    white-space: pre-wrap;
    flex-direction:column;
    }
} */
@import '../style/mardown.scss';
</style>
